<template>
    <div id="wait-rectify" class="w-h-100 pos-r flex-1 apply-container page-public-s" style="box-sizing: border-box;overflow:hidden;">
        <div class="w-h-100 ver-flex pos-a" style="box-sizing: border-box; padding: 6px;">
            <div style="box-sizing: border-box;">
                <el-card shadow="never" :body-style="{ paddingBottom: '0' }">
                    <el-form class="box-f" ref="queryForm" :inline="true">
                        <el-form-item >
                            <el-button v-if="$hasPer('WaitRectify:excel')" @click="handleExport" icon="ele-Download"> 导出数据 </el-button>
                            <el-button class="icon-e" text>待整改记录数量<span style="color: #409EFF;margin-left: 5px;">{{ state.n_ToBeRectificationRecordCount }}</span></el-button>
                            <!-- <el-button  @click="stateClick(1,getData)" class="icon-e" text>待复查记录数量<span style="color: #67C23A;margin-left: 5px;">{{ state.n_ToBeReviewRecordCount }}</span></el-button>
                            <el-button  @click="stateClick(2,getData)" class="icon-e" text>待验收记录数量<span style="color: #865205;margin-left: 5px;">{{ state.n_ToBeAcceptanceRecordCount }}</span></el-button>
                            <el-button  @click="stateClick(3,getData)" class="icon-e" text>已归档记录数量<span style="color: #E6A23C;margin-left: 5px;">{{ state.n_FinishedRecordCount }}</span></el-button>
                            <el-button  @click="stateClick(4,getData)" class="icon-e" text>复查不通过记录数量<span style="color: #F56C6C;margin-left: 5px;">{{ state.n_ReviewnNoPassRecordCount }}</span></el-button>
                            <el-button  @click="stateClick(5,getData)" class="icon-e" text>验收不通过记录数量<span style="color: #c6ff40;margin-left: 5px;">{{ state.n_AcceptanceNoPassRecordCount }}</span></el-button> -->
                        </el-form-item>
                    </el-form>
                </el-card>
            </div>

            <div style="box-sizing: border-box;" class="flex-1 pos-r">
                <div class="pos-a w-h-100" style="box-sizing: border-box;">
                    <el-card class="box-card w-h-100" shadow="never" style="margin-top: 16px;">
                        <div style="" class="w-h-100 ver-flex">
                            <div class="flex-1 pos-r">
                                <div class="pos-a w-h-100">
                                    <el-table 
                                        ref="excelRef"
                                        :data="list" 
                                        class="w-h-100" 
                                        style="width: 100%" 
                                        border 
                                        v-loading="loading" 
                                        element-loading-background="rgba(0, 0, 0, 0.5)"
                                    >

                                        <!-- <el-table-column min-width="200" :show-overflow-tooltip="true" label="第几次整改"  align="center" prop="n_Times" sortable>
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="i_Times" typeVal="input" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.n_Times">{{ scope.row.n_Times }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column> -->

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="整改类型"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Type" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_TypeName">{{ scope.row.v_TypeName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="400" :show-overflow-tooltip="true" label="整改期限"  align="center" prop="d_LimitTime" sortable>
                                            <el-table-column :show-overflow-tooltip="true" min-width="400" align="center">
                                                <template #header>
                                                    <SearchModel typeId="d_Limit" typeVal="daterange" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.d_LimitTime">{{ scope.row.d_LimitTime.split(' ')[0] }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="是否为现场整改"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_SceneRectify" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.isSceneRectify" style="color: #409EFF;">是</span>
                                                    <span v-else style="color: #F56C6C;">否</span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="整改部门"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Dep" typeVal="cascader" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_RectifyDeptName">{{ scope.row.v_RectifyDeptName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="整改人"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Rectify" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_RectifyUserName">{{ scope.row.v_RectifyUserName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="整改措施"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Measures" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_Measures">{{ scope.row.v_Measures }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="整改状态"  align="center">
                                            <template #default="scope">
                                                <span v-if="scope.row.n_State === 0" style="color: #909399;">{{ scope.row.v_StateName }}</span>
                                                <span v-if="scope.row.n_State === 1" style="color: #E6A23C;">{{ scope.row.v_StateName }}</span>
                                                <span v-if="scope.row.n_State === 2" style="color: #67C23A;">{{ scope.row.v_StateName }}</span>
                                                <span v-if="scope.row.n_State === 3" style="color: #409EFF;">{{ scope.row.v_StateName }}</span>
                                                <span v-if="scope.row.n_State === 4" style="color: #F56C6C;">{{ scope.row.v_StateName }}</span>
                                                <span v-if="scope.row.n_State === 5" style="color: #865205;">{{ scope.row.v_StateName }}</span>
                                            </template>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="是否整改转办"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Shift" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.isRectificationShift" style="color: #409EFF;">是</span>
                                                    <span v-else style="color: #F56C6C;">否</span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="整改结果状态"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Rectification" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.n_RectificationState === 0" style="color: #409EFF;">已消除</span>
                                                    <span v-else style="color: #F56C6C;">未消除</span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column width="400" :show-overflow-tooltip="true" label="整改日期"  align="center" prop="d_RectificationTime" sortable>
                                            <el-table-column :show-overflow-tooltip="true" width="400" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Rectification" typeVal="daterange" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.d_RectificationTime">{{ scope.row.d_RectificationTime.split(' ')[0] }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="整改文字描述"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="i_Describe" typeVal="input" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_RectificationDescribe">{{ scope.row.v_RectificationDescribe }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="复查部门"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_ReviewDep" typeVal="cascader" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_ReviewDeptName">{{ scope.row.v_ReviewDeptName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="复查人员"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_ReviewUser" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_ReviewUserName">{{ scope.row.v_ReviewUserName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column width="400" :show-overflow-tooltip="true" label="复查日期"  align="center" prop="d_ReviewTime" sortable>
                                            <el-table-column :show-overflow-tooltip="true" width="400" align="center">
                                                <template #header>
                                                    <SearchModel typeId="d_Review" typeVal="daterange" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.d_ReviewTime">{{ scope.row.d_ReviewTime.split(' ')[0] }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="复查是否转办"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_Review" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.isReviewShift" style="color: #409EFF;">是</span>
                                                    <span v-else style="color: #F56C6C;">否</span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="隐患复查结果"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_ReviewResult" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.n_ReviewResult === 0" style="color: #409EFF;">已整改</span>
                                                    <span v-else-if="scope.row.n_ReviewResult === 1" style="color: #E6A23C;">未整改</span>
                                                    <span v-else-if="scope.row.n_ReviewResult === 2" style="color: #67C23A;">整改不符合要求</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="复查意见"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="i_ReviewOpinion" typeVal="input" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_ReviewOpinion">{{ scope.row.v_ReviewOpinion }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="验收部门"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_AcceptanceDept" typeVal="cascader" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_AcceptanceDeptName">{{ scope.row.v_AcceptanceDeptName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="验收人员"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_AcceptanceUser" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_AcceptanceUserName">{{ scope.row.v_AcceptanceUserName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="是否验收转办"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_AcceptanceShift" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.isAcceptanceShift" style="color: #409EFF;">是</span>
                                                    <span v-else style="color: #F56C6C;">否</span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column width="400" :show-overflow-tooltip="true" label="验收日期"  align="center" prop="d_AcceptanceTime" sortable>
                                            <el-table-column :show-overflow-tooltip="true" width="400" align="center">
                                                <template #header>
                                                    <SearchModel typeId="d_AcceptanceTime" typeVal="daterange" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.d_AcceptanceTime">{{ scope.row.d_AcceptanceTime.split(' ')[0] }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" prop="" label="验收意见"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="i_AcceptanceOpinion" typeVal="input" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.v_AcceptanceOpinion">{{ scope.row.v_AcceptanceOpinion }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="200" :show-overflow-tooltip="true" label="验收结果"  align="center">
                                            <el-table-column :show-overflow-tooltip="true" min-width="200" align="center">
                                                <template #header>
                                                    <SearchModel typeId="s_AcceptanceState" typeVal="select" @searchHandel="searchHandel" :basicsInfo="basicsInfo" />
                                                </template>
                                                <template #default="scope">
                                                    <span v-if="scope.row.n_AcceptanceState === 0" style="color: #409EFF;">{{ scope.row.v_AcceptanceStateName }}</span>
                                                    <span v-else-if="scope.row.n_AcceptanceState === 1" style="color: #E6A23C;">{{ scope.row.v_AcceptanceStateName }}</span>
                                                    <span v-else-if="scope.row.n_AcceptanceState === 2" style="color: #67C23A;">{{ scope.row.v_AcceptanceStateName }}</span>
                                                    <span v-else> - </span>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                        <el-table-column min-width="120" :show-overflow-tooltip="true" label="处理过程"  align="center" fixed="right">
                                            <template #default="scope">
                                                <el-button @click="resultHandle(scope.row)" class="icon-e" icon="ele-View" size="small" text type="primary">查看</el-button>
                                            </template>
                                        </el-table-column>

                                        <el-table-column min-width="180" :show-overflow-tooltip="true" prop="createdTime" label="创建时间"  align="center" sortable>
                                            <template #default="scope">
                                                <span v-if="scope.row.createdTime">{{ scope.row.createdTime }}</span>
                                                <span v-else>-</span>
                                            </template>
                                        </el-table-column>

                                        <el-table-column min-width="180" :show-overflow-tooltip="true" prop="updatedTime" label="更新时间"  align="center" sortable>
                                            <template #default="scope">
                                                <span v-if="scope.row.updatedTime">{{ scope.row.updatedTime }}</span>
                                                <span v-else>-</span>
                                            </template>
                                        </el-table-column>

                                        <el-table-column width="240" label="操作" align="center" fixed="right">
                                            <el-table-column :show-overflow-tooltip="true" min-width="240" align="center">
                                                <template #header>
                                                    <el-button class="icon-e" @click='searchClick' icon="ele-Search" size="small" type="primary" text> 查询 </el-button>
                                                    <el-button class="icon-e clear-bg" style="background-color: transparent !important;" size="small" @click="resetClick" icon="ele-Refresh" text> 重置 </el-button>
                                                </template>
                                                <template #default="scope">
                                                    <el-button @click="detailHandle(scope.row.id)" class="icon-e" icon="ele-View" size="small" text type="success">详情</el-button>
                                                    <template v-if="scope.row.n_State === 0">
                                                        <el-button v-if="$hasPer('WaitRectify:turn')" @click="rectifyHandle(scope.row,0)" class="icon-e" icon="ele-Edit" size="small" text type="warning">整改转办</el-button>
                                                        <el-button v-if="$hasPer('WaitRectify:rectify')" @click="rectifyHandle(scope.row,1)" class="icon-e" icon="ele-Finished" size="small" text type="success">整改</el-button>
                                                    </template>
                                                    <template v-if="scope.row.n_State !== 0">
                                                        <el-button class="icon-e" size="small" text type="warning">{{ scope.row.v_StateName }}</el-button>
                                                    </template>
                                                </template>
                                            </el-table-column>
                                        </el-table-column>

                                    </el-table>
                                </div>
                            </div>
                            <div style="height: 30px;margin-top: 20px;" class="hr-flex-start">
								<el-pagination
									v-model:currentPage="pageNo"
									v-model:page-size="pageSize"
									:total="totalRows"
									:page-sizes="[10, 20, 50, 100]"
									small
									background
									@size-change="handleSizeChange"
									@current-change="handleCurrentChange"
									layout="total, sizes, prev, pager, next, jumper"
									class="w-h-100"
								/>
							</div>
                        </div>
                    </el-card>
                </div>
            </div>
        </div>
        <AddEditWaitRectify
            :bascObj="bascObj"
            :repairInfo="repairInfo"
            :isUseDialog="isUseDialog"
            @updateData="getData"
            @cancelUseClick="cancelUseClick"
            @controlUseClick="controlUseClick"
        />
        <TurnHold
            currentStatus="整改"
            titleCon="整改转办"
            :repairInfo="bascInfo"
            :isUseDialog="isHoldDialog"
            @updateData="getData"
            @cancelHoldClick="cancelHoldClick"
            @controlHoldClick="controlHoldClick"
        />
        <!-- 详情 -->
        <DetailModel
            :detailInfo="detailInfo"
            :MdetailDialog="MdetailDialog"
            labelWidth="140px"
            @cancelDetailClick="cancelDetailClick"
        />
        <!-- 处理过程 -->
        <DisposeCourse
            statusVal="waitTwo"
            :dispInfo="dispInfo"
            :dispDialog="dispDialog"
            @dispClick="dispClick"
        />
    </div>
</template>
<script lang="ts">
import { defineComponent, ref, Ref, onMounted , reactive , toRaw , toRefs, onBeforeMount } from 'vue';
import getTableData from '/@/utils/getTableData';
import AddEditWaitRectify from '../component/sms/add-edit-WaitRectify.vue';
import TurnHold from '../component/sms/turn-hold.vue';
import { ElMessage } from 'element-plus';
import { 
    SMSHDRectifyPage,
    SMSHDRectifyStateCount,
    sysDictDataList,
    SMSHDRectifyDetail,
} from '/@/api/centerControl/sms';
import { sysOrgTree , sysUserselectorV2 , sysFileInfoPage } from '/@/api/centerControl/pubilc';
import SearchModel from '../component/search-model.vue';
import DetailModel from '../component/detail-model.vue';
import DisposeCourse from '../component/sms/dispose-course.vue';
import { exportToExcel } from '/@/utils/exportToExcel';
import { useRoute } from 'vue-router';

export default defineComponent( {
    name: 'wait-rectify',
    components: { AddEditWaitRectify , TurnHold , SearchModel , DetailModel , DisposeCourse },
    setup(props){
        const isUseDialog = ref(false); // 新增/编辑弹出框隐藏/显示
        const repairInfo = ref(); // 传递子组件数据
        const router = useRoute();

        const dispInfo = ref();
        const dispDialog = ref(false);
        
        const bascObj = ref({
            treeData: '',
            typeData: '',
        });
        const bascInfo = ref({
            treeData: '',
            bascData: '',
        });
        const isHoldDialog = ref(false);

        const state: any = reactive({
            n_AllRecordCount: 0,
            n_CancelRecordCount: 0,
            n_CompletedRecordCount: 0,
            n_DoingRecordCount: 0,
            n_DraftRecordCount: 0,
            n_MissRecordCount: 0,
            n_TodoRecordCount: 0,
        });

        /*** 整改事件 */
        const rectifyHandle = async (val: String | Number, num: number) => {
            console.log(num,'num')
            if(num === 1){
                isUseDialog.value = true;
                repairInfo.value = JSON.stringify(val);
            }else{
                isHoldDialog.value = true;
                bascInfo.value.bascData = JSON.stringify(val);
            }
        };

        /*** 获取状态信息 */
        const getStateFun = async() => {
            let param = {
                onlyMyRecord: true,
                n_State: 0,
            }
            let res: any = await SMSHDRectifyStateCount(param);
            if(res.success) Object.assign(state, res.data);
        }

        /*** 获取数据字典值/部门数据 */
        const getDictFun = async() => {
            
        }

        /*** 登记整改结果取消事件 */
        const cancelUseClick = () => {
            isUseDialog.value = false;
        }

        /*** 登记整改结果提交事件 */
        const controlUseClick = () => {
            getStateFun();
            isUseDialog.value = false;
        }

        /*** 转办取消事件 */
        const cancelHoldClick = () => {
            isHoldDialog.value = false;
        }

        /*** 转办提交事件 */
        const controlHoldClick = () => {
            getStateFun();
            isHoldDialog.value = false;
        }

        /*** 隐患结果 */
        const resultHandle = (val: any) => {
            dispInfo.value = JSON.stringify(val);
            dispDialog.value = true;
        }

        /*** 处理过程取消事件 */
        const dispClick = () => {
            dispDialog.value = false;
        }

        /*** ================================= 详情类数据操作 =================================  */
        const MdetailDialog = ref(false);
        const detailInfo = ref();

        // 获取文件
        const getFileFun = async (sourceId: number) => {
            let param: any = {};
            param.PageNo = 1;
            param.PageSize = 99999;
            param.sourceId = sourceId;
            let res: any = await sysFileInfoPage(param);
            if(res.success) return res.data.rows;
        }
        /*** 获取详情接口数据 */
        const getDetailFun = async (id: number) => {
            let res: any = await SMSHDRectifyDetail({id: id}); // 详情
            if(res.success){
                let setArr: any = [];
                let tableRectifyArr: any = [];
                let tableReviewArr: any = [];
                let tableAcceptanceArr: any = [];
                let detailObj: any = {};
                if(res.data.l_RectifyFileId){
                    await getFileFun(res.data.l_RectifyFileId).then((item: any) => {
                        if(item.length !== 0){
                            item.map((val: any) => {
                                let itemObj: any = {};
                                itemObj['id'] = val.id;
                                itemObj['fileObjectName'] = val.fileObjectName;
                                itemObj['附件名称'] = val.fileOriginName;
                                itemObj['文件格式'] = val.fileSuffix;
                                itemObj['文件大小'] = val.fileSizeKb;
                                itemObj['文件路径'] = val.filePath;
                                tableRectifyArr.push(itemObj);
                            });
                        }
                    });
                }
                if(res.data.l_ReviewFileId){
                    await getFileFun(res.data.l_ReviewFileId).then((item: any) => {
                        if(item.length !== 0){
                            item.map((val: any) => {
                                let itemObj: any = {};
                                itemObj['id'] = val.id;
                                itemObj['fileObjectName'] = val.fileObjectName;
                                itemObj['附件名称'] = val.fileOriginName;
                                itemObj['文件格式'] = val.fileSuffix;
                                itemObj['文件大小'] = val.fileSizeKb;
                                itemObj['文件路径'] = val.filePath;
                                tableReviewArr.push(itemObj);
                            });
                        }
                    });
                }
                if(res.data.l_AcceptanceSignatureId){
                    await getFileFun(res.data.l_AcceptanceSignatureId).then((item: any) => {
                        if(item.length !== 0){
                            item.map((val: any) => {
                                let itemObj: any = {};
                                itemObj['id'] = val.id;
                                itemObj['fileObjectName'] = val.fileObjectName;
                                itemObj['附件名称'] = val.fileOriginName;
                                itemObj['文件格式'] = val.fileSuffix;
                                itemObj['文件大小'] = val.fileSizeKb;
                                itemObj['文件路径'] = val.filePath;
                                tableAcceptanceArr.push(itemObj);
                            });
                        }
                    });
                }
                // detailObj['第几次整改'] = res.data.n_Times;
                detailObj['整改类型'] = res.data.v_TypeName;
                detailObj['整改期限'] = res.data.d_LimitTime ? res.data.d_LimitTime.split(' ')[0] : '-';
                detailObj['是否现场整改'] = res.data.isSceneRectify ? '是' : '否';
                detailObj['整改人员'] = res.data.v_RectifyUserName;
                detailObj['整改部门'] = res.data.v_RectifyDeptName;
                detailObj['整改措施'] = res.data.v_Measures;
                detailObj['整改状态'] = res.data.v_StateName;
                detailObj['是否整改转办'] = res.data.isRectificationShift ? '是' : '否';
                detailObj['整改结果状态'] = res.data.n_RectificationState === 0 ? '已消除' : '未消除';
                detailObj['整改日期'] = res.data.d_RectificationTime ? res.data.d_RectificationTime.split(' ')[0] : '-';
                detailObj['整改文字描述'] = res.data.v_RectificationDescribe;
                detailObj['原因分析'] = res.data.v_Reason;
                detailObj['复查部门'] = res.data.v_ReviewDeptName;
                detailObj['复查人员'] = res.data.v_ReviewUserName;
                detailObj['复查日期'] = res.data.d_ReviewTime ? res.data.d_ReviewTime.split(' ')[0] : '-';
                detailObj['复查结果'] = res.data.v_ReviewResultName;
                detailObj['复查意见'] = res.data.v_ReviewOpinion;
                detailObj['复查是否转办'] = res.data.isReviewShift ? '是' : '否';
                detailObj['验收部门'] = res.data.v_AcceptanceDeptName;
                detailObj['验收人员'] = res.data.v_AcceptanceUserName;
                detailObj['是否验收转办'] = res.data.isAcceptanceShift ? '是' : '否';
                detailObj['验收日期'] = res.data.d_AcceptanceTime ? res.data.d_AcceptanceTime.split(' ')[0] : '-';
                detailObj['验收意见'] = res.data.v_AcceptanceOpinion;
                detailObj['验收结果'] = res.data.v_AcceptanceStateName;

                if(res.data.hidden && Object.keys(res.data.hidden).length !== 0){
                    let hiddenInfo = res.data.hidden;
                    let detailObjHidden: any = {};
                    detailObjHidden['任务名称'] = hiddenInfo.v_IPTaskName;
                    detailObjHidden['排查人员'] = hiddenInfo.v_CheckUserName;
                    detailObjHidden['排查部门'] = hiddenInfo.v_CheckDeptName;
                    detailObjHidden['隐患分类'] = hiddenInfo.v_TypeName;
                    detailObjHidden['分析单元'] = hiddenInfo.v_AnalysisUnitName;
                    detailObjHidden['巡检点'] = hiddenInfo.v_SMSDCListName;
                    detailObjHidden['是否自定义隐患'] = hiddenInfo.isCustom ? '是' : '否';
                    detailObjHidden['隐患排查日期'] = hiddenInfo.d_CheckDate ? hiddenInfo.d_CheckDate.split(' ')[0] : '-';
                    detailObjHidden['隐患描述'] = hiddenInfo.v_Describe;
                    detailObjHidden['隐患级别'] = hiddenInfo.v_HiddenLevelName;
                    detailObjHidden['隐患地点'] = hiddenInfo.v_Place;
                    detailObjHidden['隐患部位'] = hiddenInfo.v_Part;
                    detailObjHidden['隐患状态'] = hiddenInfo.v_StateName;
                    detailObjHidden['隐患分类'] = hiddenInfo.v_HiddenDangerClass;
                    setArr.push({
                        formTitle: '巡检任务基础信息',
                        type: 'form',
                        info: detailObj,
                    });
                    if(hiddenInfo.l_FileId){
                        let hiddenArr: any = [];
                        await getFileFun(hiddenInfo.l_FileId).then((item: any) => {
                            if(item.length !== 0){
                                item.map((val: any) => {
                                    let itemObj: any = {};
                                    itemObj['id'] = val.id;
                                    itemObj['fileObjectName'] = val.fileObjectName;
                                    itemObj['附件名称'] = val.fileOriginName;
                                    itemObj['文件格式'] = val.fileSuffix;
                                    itemObj['文件大小'] = val.fileSizeKb;
                                    itemObj['文件路径'] = val.filePath;
                                    hiddenArr.push(itemObj);
                                });
                            }
                        });
                        setArr.push({
                            tableTitle: '隐患图片',
                            type: 'table',
                            listData: hiddenArr,
                            minWidth: 160,
                            isShowBtn: true,
                        });
                    }
                }
                setArr.push({
                    formTitle: '基础信息',
                    type: 'form',
                    info: detailObj,
                },{
                    tableTitle: '整改后照片',
                    type: 'table',
                    listData: tableRectifyArr,
                    minWidth: 160,
                    isShowBtn: true,
                },{
                    tableTitle: '复查照片',
                    type: 'table',
                    listData: tableReviewArr,
                    minWidth: 160,
                    isShowBtn: true,
                },{
                    tableTitle: '验收电子签名',
                    type: 'table',
                    listData: tableAcceptanceArr,
                    minWidth: 160,
                    isShowBtn: true,
                });
                detailInfo.value = setArr;
                MdetailDialog.value = true;
            }
        }
        /*** 详情 */
        const detailHandle = (id: number) => {
            getDetailFun(id);
        }
        /*** 详情关闭事件 */
        const cancelDetailClick = () => {
            MdetailDialog.value = false;
        }
        /*** ================================= 详情类数据操作 =================================  */
        
        /*** ================================= 查询类数据操作 =================================  */
        let searchObj:any = reactive({
            onlyMyRecord: true,
            n_State: 0,
            // id: router.query.queryParam ? router.query.queryParam : null,
        });
        const basicsInfo: any = ref([]);
        const searInfo: any = ref();

        /*** 获取需要查询的数据 */
        const searchHandel = (val: any) => {
            searInfo.value = val;
        }

        /*** 查询按钮 */
        const searchClick = async () => {
            let newObj = Object.keys(searInfo.value);
            if(newObj.length !== 0){
                newObj.map((i:any) => {
                    searchObj[i] = searInfo.value[i];
                });
            }
            searchObj.n_State = 0;
        };

        /*** 重置按钮 */
        const resetClick = () => {
            searInfo.value = {};
            let newObj = Object.keys(searchObj);
            if(newObj.length !== 0){
                newObj.map((i:any) => {
                    searchObj[i] = ''
                });
            }
            searchObj.onlyMyRecord = true;
            searchObj.n_State = 0;
            getStateFun();
            initInfoFun();
        };

        let rectifyArr: any = [];
        let depArr: any = [];
        let measuresArr: any = [];
        // 获取数据
        const getFun = async () => {
            let rbs: any = await sysUserselectorV2({}); // 用户
            let rcs: any = await sysOrgTree({}); // 部门
            let res: any = await sysDictDataList({ TypeCode: 'rectifyType' }); // 整改措施
            if(rbs.success && rbs.data.length !== 0){
                rbs.data.map((item: any) => {
                    item.label = item.name;
                    item.value = item.id;
                });
                rectifyArr = rbs.data;
            }
            if(rcs.success && rcs.data.length !== 0){
                depArr = rcs.data;
                bascObj.value.treeData = JSON.stringify(rcs.data);
                bascInfo.value.treeData = JSON.stringify(rcs.data);
            }
            if(res.success && res.data.length !== 0){
                res.data.map((item: any) => {
                    item.label = item.value;
                    item.value = item.value;
                });
                bascObj.value.typeData = JSON.stringify(res.data);
                measuresArr = res.data;
            }
        }
        
        /*** 初始化数据 */
        const initInfoFun = async() => {
            basicsInfo.value = [{
                    typeId: 'i_Times', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: 'number', // 输入类型(number,text等) --- 选填
                    searchVal: 'n_Times', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '第几次整改', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_Type', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'n_Type', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '隐患整改类型', // placeholder数据
                    defaultProp: [
                        {label: '立即整改', value: 0},
                        {label: '限期整改', value: 1},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_Rectify', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'l_RectifyUserId', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改人员', // placeholder数据
                    defaultProp: rectifyArr, // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_Dep', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'l_RectifyDeptId', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改部门', // placeholder数据
                    defaultProp: depArr, // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                    propsVal: { checkStrictly: true , label: 'title', value: 'id', children: 'children' }, // 级联选择器 --- 选填
                },{
                    typeId: 's_Measures', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'v_Measures', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改措施', // placeholder数据
                    defaultProp: measuresArr, // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_State', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'n_State', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改状态', // placeholder数据
                    defaultProp: [
                        {label: '待整改', value: 0},
                        {label: '待复查', value: 1},
                        {label: '待验收', value: 2},
                        {label: '已归档', value: 3},
                        {label: '复查不通过', value: 4},
                        {label: '验收不通过', value: 5},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_Shift', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'isRectificationShift', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '是否整改转办', // placeholder数据
                    defaultProp: [
                        {label: '是', value: true},
                        {label: '否', value: false},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_Rectification', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'n_RectificationState', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改结果', // placeholder数据
                    defaultProp: [
                        {label: '已消除', value: 0},
                        {label: '未消除', value: 1},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'd_Time', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchValMin: 'd_RectificationTimeMin', // 查询字段 --- 必填
                    searchValMax: 'd_RectificationTimeMax', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改日期', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'd_Limit', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchValMin: 'd_LimitTimeMin', // 查询字段 --- 必填
                    searchValMax: 'd_LimitTimeMax', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改期限', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'i_Describe', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'v_RectificationDescribe', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '整改文字描述', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_ReviewDep', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'l_ReviewDeptId', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '复查部门', // placeholder数据
                    defaultProp: depArr, // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                    propsVal: { checkStrictly: true , label: 'title', value: 'id', children: 'children' }, // 级联选择器 --- 选填
                },{
                    typeId: 's_ReviewUser', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'l_ReviewUserId', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '复查人员', // placeholder数据
                    defaultProp: rectifyArr, // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'd_Review', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchValMin: 'd_ReviewTimeMin', // 查询字段 --- 必填
                    searchValMax: 'd_ReviewTimeMax', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '复查日期', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_Review', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'isReviewShift', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '复查是否转办', // placeholder数据
                    defaultProp: [
                        {label: '是', value: true},
                        {label: '否', value: false},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_ReviewResult', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'n_ReviewResult', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '复查结果', // placeholder数据
                    defaultProp: [
                        {label: '已整改', value: 0},
                        {label: '未整改', value: 1},
                        {label: '整改不符合要求', value: 2},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'i_ReviewOpinion', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'V_ReviewOpinion', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '复查意见', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_AcceptanceDept', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'l_AcceptanceDeptId', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '验收部门', // placeholder数据
                    defaultProp: depArr, // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                    propsVal: { checkStrictly: true , label: 'title', value: 'id', children: 'children' }, // 级联选择器 --- 选填
                },{
                    typeId: 's_AcceptanceUser', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'l_AcceptanceUserId', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '验收人员', // placeholder数据
                    defaultProp: rectifyArr, // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_AcceptanceShift', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'isAcceptanceShift', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '是否验收转办', // placeholder数据
                    defaultProp: [
                        {label: '是', value: true},
                        {label: '否', value: false},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'd_AcceptanceTime', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchValMin: 'd_AcceptanceTimeMin', // 查询字段 --- 必填
                    searchValMax: 'd_AcceptanceTimeMax', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '验收日期', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'i_AcceptanceOpinion', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'v_AcceptanceOpinion', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '验收意见', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_AcceptanceState', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'n_AcceptanceState', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '验收结果', // placeholder数据
                    defaultProp: [
                        {label: '同意验收', value: 0},
                        {label: '不同意验收', value: 1},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 's_SceneRectify', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'isSceneRectify', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '是否现场整改', // placeholder数据
                    defaultProp: [
                        {label: '是', value: true},
                        {label: '否', value: false},
                    ], // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                },{
                    typeId: 'i_Reason', // 类型(不能为空，且唯一，与组件中typeId值对应) --- 必填
                    typeNam: '', // 输入类型(number,text等) --- 选填
                    searchVal: 'v_Reason', // 查询字段 --- 必填
                    defaultVal: '', // 字段默认值 --- 选填
                    placeholder: '原因分析', // placeholder数据
                    defaultProp: '', // 下拉框中使用，除下拉框外其它情况为空 --- 选填
                    eventType: '', // 事件类型（如burl/change等） --- 选填
                    defaultEvent: '', // 事件名称 --- 选填
                }
            ]
        }

        onBeforeMount(() => {
            searchObj.id = router.query.queryParam ? router.query.queryParam : null;
        });

        onMounted(async () => {
            // searchObj.id = router.query.queryParam ? router.query.queryParam : null; 
            await getStateFun();
            await getFun();
            await getDictFun();
            await initInfoFun();
        });
        /*** ================================= 查询类数据操作 =================================  */

        /*** ================================= 导出数据函数操作 ================================= */
        const excelRef: any = ref(null);
        const handleExport = () => {
            if(excelRef){
                if(excelRef.value.data.length !== 0){
                    let tableExcel: any = [];
                    let tableArr = excelRef.value.data;
                    tableArr.map((item: any) => {
                        let tableObj: any = {};
                        // tableObj['第几次整改'] = item.n_Times ? item.n_Times : '-';
                        tableObj['整改类型'] = item.v_TypeName ? item.v_TypeName : '-';
                        tableObj['整改期限'] = item.d_LimitTime ? item.d_LimitTime.split(' ')[0] : '-';
                        tableObj['是否现场整改'] = item.isSceneRectify ? '是' : '否';
                        tableObj['整改人员'] = item.v_RectifyUserName ? item.v_RectifyUserName : '-';
                        tableObj['整改部门'] = item.v_RectifyDeptName ? item.v_RectifyDeptName : '-';
                        tableObj['整改措施'] = item.v_Measures ? item.v_Measures : '-';
                        tableObj['整改状态'] = item.v_StateName ? item.v_StateName : '-';
                        tableObj['是否整改转办'] = item.isRectificationShift ? '是' : '否';
                        tableObj['整改结果状态'] = item.n_RectificationState === 0 ? '已消除' : '未消除';
                        tableObj['整改日期'] = item.d_RectificationTime ? item.d_RectificationTime.split(' ')[0] : '-';
                        tableObj['整改文字描述'] = item.v_RectificationDescribe ? item.n_Times : '-';
                        tableObj['原因分析'] = item.v_Reason ? item.v_Reason : '-';
                        tableObj['复查部门'] = item.v_ReviewDeptName ? item.v_ReviewDeptName : '-';
                        tableObj['复查人员'] = item.v_ReviewUserName ? item.v_ReviewUserName : '-';
                        tableObj['复查日期'] = item.d_ReviewTime ? item.d_ReviewTime.split(' ')[0] : '-';
                        tableObj['复查结果'] = item.v_ReviewResultName ? item.v_ReviewResultName : '-';
                        tableObj['复查意见'] = item.v_ReviewOpinion ? item.v_ReviewOpinion : '-';
                        tableObj['复查是否转办'] = item.isReviewShift ? '是' : '否';
                        tableObj['验收部门'] = item.v_AcceptanceDeptName ? item.v_AcceptanceDeptName : '-';
                        tableObj['验收人员'] = item.v_AcceptanceUserName ? item.v_AcceptanceUserName : '-';
                        tableObj['是否验收转办'] = item.isAcceptanceShift ? '是' : '否';
                        tableObj['验收日期'] = item.d_AcceptanceTime ? item.d_AcceptanceTime.split(' ')[0] : '-';
                        tableObj['验收意见'] = item.v_AcceptanceOpinion ? item.v_AcceptanceOpinion : '-';
                        tableObj['验收结果'] = item.v_AcceptanceStateName ? item.v_AcceptanceStateName : '-';
                        tableExcel.push(tableObj);
                    });
                    exportToExcel(tableExcel,'待整改隐患.xlsx');
                }else{
                    ElMessage({
                        type: 'error',
                        message: '暂无数据导出',
                    })
                }
            }
        }
        /*** ================================= 导出数据函数操作 ================================= */

        return {
            ...getTableData(SMSHDRectifyPage,{},searchObj),
            state,
            rectifyHandle,

            repairInfo,
            isUseDialog,
            cancelUseClick,
            controlUseClick,
            bascObj,
            bascInfo,
            isHoldDialog,
            cancelHoldClick,
            controlHoldClick,

            // 导出Excel
            excelRef,
            handleExport,
            
            // 处理过程
            resultHandle,
            dispInfo,
            dispDialog,
            dispClick,
            
            // 详情
            MdetailDialog,
            detailHandle,
            detailInfo,
            cancelDetailClick,

            // 查询事件
            basicsInfo,
            searchHandel,
            searchClick,
            resetClick,
        }
    },
} )
</script>
<style lang="scss"> @import '../style/public.scss'; </style>
<style scoped lang="scss">
    ul {
        list-style: none;
        li {
            cursor: pointer;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            text-align: center;
            padding: 10px 0;
        }
    }
    .search-s{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        width: 100%;
        .search-s-l{
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: center;
            width: 98%;
        }
    }
    #wait-rectify {
        .box-f{
            :deep(.el-form-item__label){
                padding: 0;
            }
        }
        :deep(.el-card__body) {
            height: 100%;
        }
        :deep(.el-card){
            border: none !important;
        }
        .upload-demo{
            margin-left: 12px;
            margin-top: 2px;
        }
        .icon-e{
            :deep(.el-icon){
                margin-right: 0px!important;
            }
        }
    }
.clear-bg{
    background-color: transparent !important;
}
</style>